﻿//-----------------------------------------------------------------------
// <copyright file="DancTeXErrorInfo.cs" company="Cord Burmeister">
//     Copyright © 2012 Cord Burmeister. All rights reserved.
// 	Microsoft Public License (http://www.microsoft.com/opensource/licenses.mspx#Ms-PL)
// </copyright>
// <authorCord Burmeister</author>
// <email>danctex2010@outlook.com</email>
//-----------------------------------------------------------------------
namespace DancTeX.Build.Tasks
{
    using System;
    using System.Collections.Generic;
    using System.Text;

    /// <summary>
    /// Types of stored warning and errors
    /// </summary>
    internal enum DancTeXErrorInfoType
    {
        /// <summary>
        /// This is a error
        /// </summary>
        Error,

        /// <summary>
        /// This is a warning
        /// </summary>
        Warning,
    }

    /// <summary>
    /// Internal structure to store errors and warnings
    /// </summary>
    internal class DancTeXErrorInfo
    {
        /// <summary>
        /// Initializes a new instance of the <see cref="DancTeXErrorInfo"/> class.
        /// </summary>
        /// <param name="type">The DancTeXErrorInfoType object to fill  .</param>
        /// <param name="fromLine">From line, as the libe number.</param>
        /// <param name="toLine">To line, as the libe number.</param>
        /// <param name="message">The error message.</param>
        /// <param name="fileName">Name of the file.</param>
        public DancTeXErrorInfo(DancTeXErrorInfoType type, int fromLine, int toLine, string message, string fileName)
        {
            this.Type = type;
            this.FromLine = fromLine;
            this.ToLine = toLine;
            this.Message = message;
            this.FileName = fileName;
        }        
        
        /// <summary>
        /// Gets or sets the type.
        /// </summary>
        /// <value>
        /// The error type object.
        /// </value>
        public DancTeXErrorInfoType Type { get; set; }

        /// <summary>
        /// Gets or sets from line.
        /// </summary>
        /// <value>
        /// From line where the error occurs.
        /// </value>
        public int FromLine { get; set; }

        /// <summary>
        /// Gets or sets to line.
        /// </summary>
        /// <value>
        /// To line where the error occurs.
        /// </value>
        public int ToLine { get; set; }

        /// <summary>
        /// Gets or sets the message.
        /// </summary>
        /// <value>
        /// The message of the error.
        /// </value>
        public string Message { get; set; }

        /// <summary>
        /// Gets or sets the name of the file.
        /// </summary>
        /// <value>
        /// The name of the file.
        /// </value>
        public string FileName { get; set; }
    }
}